package com.xxcxcxcx.jobsystem.mixin.job.Herdsman;

import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.OwnableEntity;
import net.minecraft.world.entity.TamableAnimal;
import net.minecraft.world.entity.animal.Animal;
import net.minecraft.world.level.Level;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(TamableAnimal.class)
public abstract class TamableAnimalMixin extends Animal implements OwnableEntity {
    @Shadow public abstract void setTame(boolean p_21836_);

    protected TamableAnimalMixin(EntityType<? extends TamableAnimal> p_21803_, Level p_21804_) {
        super(p_21803_, p_21804_);
    }

    @Inject(method = "setOwnerUUID",at = @At(value = "TAIL"))
    private void WolfAttributes(CallbackInfo ci) {
        this.setTame(true);
    }
}